package com.meihua.shellapp.adapter.personalcenter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.meihua.shellapp.R;

import java.util.List;

/**
 * 作者：lc on 2017/9/26.
 * 邮箱：lc0607live@163.com
 */

public class AccountSecurityAdapter extends BaseAdapter {

    private Context mContext;
    private List<String> mDataStr;
    private List<String> mDataValueStr;

    public AccountSecurityAdapter(Context mContext, List<String> mDataStr, List<String> mDataValueStr) {
        this.mContext = mContext;
        this.mDataStr = mDataStr;
        this.mDataValueStr = mDataValueStr;
    }

    @Override
    public int getCount() {
        return mDataStr == null ? 0 : mDataStr.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        ViewHolder holder;
        if (view == null) {
            holder = new ViewHolder();
            view = LayoutInflater.from(mContext).inflate(R.layout.item_account_security, null);
            holder.tv_item_account_security = view.findViewById(R.id.tv_item_account_security);
            holder.tv_item_account_security_value = view.findViewById(R.id.tv_item_account_security_value);
        } else {
            holder = (ViewHolder) view.getTag();
        }
        holder.tv_item_account_security.setText(mDataStr.get(i));
        holder.tv_item_account_security_value.setText(mDataValueStr.get(i));
        return view;
    }

    class ViewHolder {
        TextView tv_item_account_security_value;
        TextView tv_item_account_security;
        ImageView iv_item_account_security;
    }
}
